package com.geeguo.ebuilder.operation.business.system.logincertificate.service.impl;

import com.geeguo.ebuilder.operation.business.system.logincertificate.mapper.LoginCertificateMapper;
import com.geeguo.ebuilder.operation.business.system.logincertificate.model.LoginCertificateEntity;
import com.geeguo.ebuilder.operation.business.system.logincertificate.service.LoginCertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginCertificateServiceImpl implements LoginCertificateService {

    @Autowired
    private LoginCertificateMapper loginCertificateMapper;

    @Override
    public LoginCertificateEntity getByCertificate(String certificate) {
        return loginCertificateMapper.getByCertificate(certificate);
    }

    @Override
    public boolean save(LoginCertificateEntity entity) {
        return loginCertificateMapper.insert(entity) > 0;
    }

    @Override
    public boolean removeByUserId(String userId) {
        return loginCertificateMapper.removeByUserId(userId) >= 0;
    }
}